/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.teacake.filteringproxy;
import java.util.HashMap;
/**
 *
 * @author tkleisas
 */
public class LogManager {
    public LogManager(String logbase)
    {
        m_logfiles = new HashMap<String, Logfile>();
        m_logbase = logbase;
    }
    public synchronized Logfile getLogfile(String logfile)
    {
        Logfile log = m_logfiles.get(logfile);
        if(log == null)
        {
            try
            {
                log = new Logfile(m_logbase+logfile);
                m_logfiles.put(logfile, log);

            }
            catch(Exception e)
            {
                log = null;
            }

        }
        return log;
    }
    private HashMap<String, Logfile> m_logfiles;
    private String m_logbase;
}
